package net.oschina.app.emoji;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class MyPagerAdapter extends FragmentStatePagerAdapter {
    private EmojiBody.OnEmojiClickLitener mOnEmojiClickLitener;

    public void setOnEmojiClickLitener(EmojiBody.OnEmojiClickLitener onEmojiClickLitener) {
        mOnEmojiClickLitener = onEmojiClickLitener;
    }

    public MyPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        EmojiBody view = new EmojiBody();
        //设置回调
        view.setOnEmojiClickLitener(mOnEmojiClickLitener);
        return view;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return "QQ表情";
    }

}
